package com.lonely.web.controller.goods;

import com.lonely.common.core.domain.TimeLine;
import com.lonely.common.core.domain.api.R;
import com.lonely.goods.service.IMaterialLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 黄志标
 * @date: 2025/6/24 9:23
 * @description: 物料日志请求处理器
 */
@RestController
@RequestMapping("/goodsManager/material/log")
@Api(tags = "商品管理/物料日志")
public class MaterialLogController {

    @Autowired
    private IMaterialLogService materialPurchaseLogService;

    /**
     * 获取指定物料的日志时间线
     *
     * @param materialId
     * @return
     */
    @GetMapping("/getLogTimeLine/{materialId}")
    @ApiOperation(value = "获取指定物料的日志时间线")
    public R<List<TimeLine>> getLogTimeLine(@PathVariable("materialId") Long materialId) {
        return R.data(this.materialPurchaseLogService.getLogTimeLine(materialId));
    }


}
